/**
 * API 配置文件
 */
import {wxRequest} from "@/utils/wxRequest";
const isDev = true;
const host =  "https://gatherapi.haomengpeifang.com";
// let host = isDev ? "127.0.0.1:11219" : "https://www.tantimes.cn/miniApp";
// let host = isDev ? "http://gatherapi.imine.club" : "https://www.tantimes.cn/miniApp";

//==============================ck begin=========================

// 获取图形验证码
const getImageCode = (params) => wxRequest(params, host + "/common/validateCode/imageCode");
// 用户登录
const userLogin = (params) => wxRequest(params, host + "/app/front/user/login");
// 发送短信验证码
const sendSms = (params) => wxRequest(params, host + "/aliyun/sms/sendSms");

//===============================ck =end ========================


//=============唐健罡 接口start========================

// 热门最多15条数据
const getHotProd = (params) => wxRequest(params, host + "/app/goods/brand/hot");
// 查询品牌-可见品牌
const goodsBrandSearch = (params) => wxRequest(params, host + "/app/goods/brand/search");
//获取分类
const goodsCateSearch = (params,type) => wxRequest(params, host + "/app/goods/category/search/"+type);
//商品搜索或者根据类型列表商品
const goodsSearch = (params) => wxRequest(params, host + "/app/goods/search");
//详情页介绍数据获取
const artGetByType = (params,type) => wxRequest(params, host + "/app/article/getByType/"+type);
// 查询商品成交记录 params[goodsId]=xxx,params['size']=yyy这个两个参数必须
const goodsDeal = (params) => wxRequest(params, host + "/app/goods/deal");
//商品买家出价 params[goodsId]=xxx,params['size']=yyy这个两个参数必须
const goodsSearchBuyerOffer = (params) => wxRequest(params, host + "/app/goods/searchBuyerOffer");
//商品卖家出价 params[goodsId]=xxx,params['size']=yyy这个两个参数必须
const goodsSearchSellerOffer = (params) => wxRequest(params, host + "/app/goods/searchSellerOffer");
// 商品详细
const goodsDetail = (params) => wxRequest(params, host + "/app/goods/detail");
// 获取默认地址
const defaultAddress = (params,userId) => wxRequest(params, host + "/app/front/user/address/listUserAddress/"+userId);
//我的购买列表,参数params['userId']=xxx,当前用户id必须
const goodsListMeBuy = (params) => wxRequest(params, host + "/app/goods/listMeBuy");
//我的出售列表，参数params['userId']=xxx,当前用户id必须
const goodsListMeSale = (params) => wxRequest(params, host + "/app/goods/listMeSale");
//查询可用物流公司-目前默认是顺丰,前端根据物流公司代码只显示顺丰物流这一条数据，如果没有用户将不能提交订单
const logGetUseable = (params) => wxRequest(params, host + "/app/logistics/getUseable");
//查询相关的商品-同分类随机三个
const goodsRelation = (params,goodsId) => wxRequest(params, host + "/app/goods/relation/"+goodsId);
//更新出价价格
const goodsUpdateOfferAmount = (params) => wxRequest(params, host + "/app/goods/updateOfferAmount");
// 获取商品所有尺寸的最低售价
const goodsSizeAndMinAmount = (params,goodsId) => wxRequest(params, host + "/app/goods/listSizeAndMinAmount/"+goodsId);
//查询用户缴纳的押金记录 如果返回无记录则未交
const disGetByUserId = (params,userId) => wxRequest(params, host + "/app/order/disposit/getByUserId/"+userId);
//获取配置费用
const getJfPrice = (params) => wxRequest(params, host + "/app/config/getConfig");
//App端缴纳押金,返回的订单状态如果为FINISH则不需要支付 否则需要支付
const disCreate = (params) => wxRequest(params, host + "/app/order/disposit/create");
//对订单进行支付-创建支付订单
const orderTrade = (params) => wxRequest(params, host + "/app/order/trade");
//创建保证金订单-买家卖家出价记录,返回的订单状态如果为FINISH则不需要支付
const bondCreate = (params) => wxRequest(params, host + "/app/order/bond/create");
// 直接购买
const orderBuyImme = (params) => wxRequest(params, host + "/app/order/buyImme");
//撤销出价
const goodsUndo = (params,query) => wxRequest(params, host + "/app/goods/undo"+query);
//出售-卖家最低价等于买家最高出价
const orderSale = (params) => wxRequest(params, host + "/app/order/sale");
//根据物流公司和用户选择的地址信息查询对应的物流费用-下单时使用
const getLogisticsPrice = (params) => wxRequest(params, host + "/app/logistics/getLogisticsPrice");
//获取用户排名
const userGetUserRank = (params,userId) => wxRequest(params, host + "/app/front/user/getUserRank/"+userId);
//付款时补全收货地址信息-返回的订单信息状态不为WAIT_PAY时不需要支付
const orderCompleteAddress = (params) => wxRequest(params, host + "/app/order/completeAddress");
//查询商品订单
const listOrderGoods = (params) => wxRequest(params, host + "/app/order/listOrderGoods");
//获取用户可用的优惠券-特定环境下(交保证金只能免保证金卷和现金券)
const listUserCouponByType = (params) => wxRequest(params, host + "/app/coupon/listUserCouponByType");
//确认收货
const buyerReceive = (params,orderId) => wxRequest(params, host + "/app/order/buyerReceive/"+orderId);
//卖家发货
const orderSellerSend = (params) => wxRequest(params, host + "/app/order/sellerSend");
//根据物流单号查询物流信息
const logisticsNo = (params,logisticsNo) => wxRequest(params, host + "/app/logistics/listExpress/"+logisticsNo);
//上传文件到阿里oss,支持多文件上传
const getWebPolicy = (params) => wxRequest(params, host + "/aliyun/oss/upload");
//获取商品收货地址或者卖家回退地址
const getAddress = (params) => wxRequest(params, host + "/app/order/getAddress");


//=============唐健罡 接口end========================

//=============张鹏 接口start========================
// 获取用户所有的优惠券
const listUserCouponUsingGET = (params,geturl) => wxRequest(params, host + geturl);
// 鉴定统计
const countIdentify = (params) => wxRequest(params, host + "/app/identify/countIdentify");
// 查询鉴定数据列表
const queryIdentify = (params) => wxRequest(params, host + "/app/identify/search");
// 查询鉴定详细
const queryIdentifyId = (params,myid) => wxRequest(params, host + '/app/identify/detail/'+myid);
// 发布鉴定
const commitIdentify = (params) => wxRequest(params, host + "/app/identify/create");
// 获取banner
const getContentConfigInfo = (params,type) => wxRequest(params, host + "/app/article/getByType/"+type);
// 获取所有的省数据
const getProvince = (params) => wxRequest(params, host + "/app/logistics/listProvince");
// 获取所有的市数据
const getCity = (params) => wxRequest(params, host + "/app/logistics/listCity");
// 获取所有的区数据
const getArea = (params) => wxRequest(params, host + "/app/logistics/listArea");
// 获取用户所有地址列表
const getAllList = (params,myid) => wxRequest(params, host + "/app/front/user/address/listUserAddress/"+myid);
// 删除地址
const deleteAddress = (params,addressId) => wxRequest(params, host + "/app/front/user/address/delete/"+addressId);
// 设置默认地址
const setDefaultAddress = (params,query) => wxRequest(params, host + "/app/front/user/address/setDefault?"+query);
// 修改或添加地址
const modifyOrAddAddress = (params) => wxRequest(params, host + "/app/front/user/address/createOrUpdate");
// 获取用户信息
const getUserInformation = (params,myid) => wxRequest(params, host + "/app/front/user/getUserById/"+myid);
// 修改用户信息
const updateUserInformation = (params,query) => wxRequest(params, host + "/app/front/user/profile?"+query);
// 修改手机号码
const updatePhoneNum = (params,query) => wxRequest(params, host + "/app/front/user/changePhone?"+query);
// 绑定支付宝
const bindAliAcc = (params) => wxRequest(params, host + "/app/front/user/bindAliAcc");
// 绑定手机号
const bindPhone = (params,query) => wxRequest(params, host + "/app/front/user/bindPhone?"+query);
// 微信登录
const wxLogin = (params,query) => wxRequest(params, host + "/app/front/user/wxmini/login?"+query);
// 微信注册第一步
const wxRegister = (params,query) => wxRequest(params, host + "/app/front/user/wxmini/register?"+query);
// 微信注册第二步
const wxRegisterToo = (params,query) => wxRequest(params, host + "/app/front/user/wxmini/unionId?"+query);
// 手机注册
const phoneRegister = (params,query) => wxRequest(params, host + "/app/front/user/phone/register?"+query);
// 创建VIP支付
const createVip = (params,query) => wxRequest(params, host + "/app/order/createVip?"+query);
// 获取openid
const getOpenid = (params,query) => wxRequest(params, host + "/app/front/user/openid?"+query);
// 退出登录
const logout = (params,query) => wxRequest(params, host + "/app/front/user/logout?"+query);
// 商品退回订单
const listOrderReturn = (params) => wxRequest(params, host + "/app/order/listOrderReturn");
// 验证cdkey
const cdKeyCheck = (params,key) => wxRequest(params, host + "/app/identify/cdKeyCheck/"+key);
// 获取支付宝
const getAliAcc = (params,key) => wxRequest(params, host + "/app/front/user/getAliAcc/"+key);
// 复议重新上传图片
const uploadAgain = (params) => wxRequest(params, host + "/app/identify/reconsider/update");


//=============张鹏 接口end========================









export default {
    userLogin,
    sendSms,
    getContentConfigInfo,
    getHotProd,
    listUserCouponUsingGET,
    goodsSearch,
    goodsBrandSearch,
    queryIdentify,
    queryIdentifyId,
    commitIdentify,
    getProvince,
    getCity,
    getArea,
    getAllList,
    deleteAddress,
    setDefaultAddress,
    modifyOrAddAddress,
    getUserInformation,
    updateUserInformation,
    getImageCode,
    updatePhoneNum,
    bindAliAcc,
    bindPhone,
    wxLogin,
    wxRegister,
    wxRegisterToo,
    phoneRegister,
    createVip,
    getOpenid,
    logout,
    countIdentify,
    listOrderReturn,
    cdKeyCheck,
    getAliAcc,
    uploadAgain,













    goodsCateSearch,
    goodsDeal,
    goodsDetail,
    goodsSearchBuyerOffer,
    goodsSearchSellerOffer,
    orderBuyImme,
    orderTrade,
    defaultAddress,
    goodsSizeAndMinAmount,
    goodsListMeBuy,
    goodsListMeSale,
    bondCreate,
    logGetUseable,
    goodsRelation,
    goodsUpdateOfferAmount,
    disGetByUserId,
    getJfPrice,
    disCreate,
    goodsUndo,
    orderSale,
    getLogisticsPrice,
    userGetUserRank,
    orderCompleteAddress,
    listOrderGoods,
    listUserCouponByType,
    buyerReceive,
    orderSellerSend,
    logisticsNo,
    artGetByType,
    getWebPolicy,
    getAddress
}
